package org.example.service.imp;

import org.example.dao.UserDao;
import org.example.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestService {
    @Autowired
    private UserDao userDao;
    public String test(String s){
        System.out.println("test");
        return "return成功";
    }
    public void testTransaction(){
        User user = new User();
        user.setUsername("transactionTest");
        user.setEmail("fafdafaf@qq.com");
        user.setPassword("fdafafa");
        userDao.saveOne(user);
//        throw new NullPointerException("假的空指针");
    }
}
